package BSTTree;

/**
 * Description:
 * Author:    Dane
 * CreateTime:2024/8/24-下午3:25
 * Since  :   1.0
 * Version:   1.0
 */
public class BST {

    public Node root;

    public  void midOrder(){
        if (root == null) {
            System.out.println("root is null");
        }else {
            root.midOrder();
        }
    }

    public void add(Node node){
        if (root == null) {
            root=node;
        }else {
            root.add(node);
        }
    }

    public static void main(String[] args) {
        BST bst = new BST();
        int []arr={7,3,10,12,5,1,9,2};
        for(int i:arr){
            bst.add(new Node(i));
        }
        bst.midOrder();
    }


}
